// 引入路由组件

// 配置路由信息

export default [
  // 重定向 在项目跑起来时，访问。立马把它定到首页
  {
    path: "/",
    component: () => import("@/views/Login"),
    redirect: "/login",
  },
  {
    path: "/login",
    component: () => import("@/views/Login"),
  },
  {
    path: "/my",
    component: () => import("@/views/my"),
    redirect: "/my/userInfo",
    children: [
      {
        path: "buy",
        component: () => import("@/views/my/Buy"),
      },
      {
        path: "userinfo",
        component: () => import("@/views/my/myinfo/userInfo"),
      },
      {
        path: "wall",
        component: () => import("@/views/my/wallCard"),
      },
      {
        path: "goods",
        component: () => import("@/views/my/Goods"),
        children: [
          {
            path: "", // 二级路由为空路径，表示默认显示 getgoods 子路由
            redirect: "getgoods",
          },
          {
            path: "getgoods",
            component: () => import("@/views/my/Goods/getGoods"),
          },
          {
            path: "helpgoods",
            component: () => import("@/views/my/Goods/helpGoods"),
          },
        ],
      },
      {
        path: "request",
        component: () => import("@/views/my/request"),
      },
      {
        path: "user-pwd",
        component: () => import("@/views/my/myinfo/userPwd"),
      },
      {
        path: "mycards",
        component: () => import("@/views/my/myCards"),
      },
      {
        path: "chat",
        component: () => import("@/views/my/Chat"),
        redirect: "/my/chat/info",
        children: [
          {
            path: "info",
            component: () => import("@/views/my/Chat/UserInfo"),
          },
          {
            path: "chatbox",
            component: () => import("@/views/my/Chat/chatBox"),
          },
        ],
      },
    ],
  },
];
